package com.example.demo;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.beans.factory.annotation.Value;

//import javax.annotation.PostConstruct;

@Controller // 当前类为控制器
@ResponseBody // 返回的是数据，而非页面
public class User2 {
    @Value("${name}")
    private String name;

    @Value("${password}")
    private String password;

    @RequestMapping("/user2")
    public String get(){
        return "name: "+name+"<br>"+
                "password: "+password;
    }
}
